package com.ruoyi.ihome.service.impl;

import com.ruoyi.ihome.domain.Apartment;
import com.ruoyi.ihome.domain.ApartmentAndFacility;
import com.ruoyi.ihome.mapper.ApartmentAndFacilityMapper;
import com.ruoyi.ihome.mapper.ApartmentMapper;
import com.ruoyi.ihome.service.IApartmentAndFacilityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 公寓设置中间表Service业务层处理
 *
 * @author zy
 * @date 2024-08-13
 */
@Service
public class ApartmentAndFacilityServiceImpl implements IApartmentAndFacilityService
{
    @Resource
    private ApartmentAndFacilityMapper apartmentAndFacilityMapper;

    @Resource
    private ApartmentMapper apartmentMapper;

    /**
     * 查询公寓设置中间表
     *
     * @param id 公寓设置中间表主键
     * @return 公寓设置中间表
     */
    @Override
    public ApartmentAndFacility selectApartmentAndFacilityById(Long id)
    {
        return apartmentAndFacilityMapper.selectApartmentAndFacilityById(id);
    }

    /**
     * 查询公寓设置中间表列表
     *
     * @param apartmentAndFacility 公寓设置中间表
     * @return 公寓设置中间表
     */
    @Override
    public List<ApartmentAndFacility> selectApartmentAndFacilityList(ApartmentAndFacility apartmentAndFacility)
    {
        return apartmentAndFacilityMapper.selectApartmentAndFacilityList(apartmentAndFacility);

    }

    /**
     * 新增公寓设置中间表
     *
     * @param apartmentAndFacility 公寓设置中间表
     * @return 结果
     */
    @Override
    public int insertApartmentAndFacility(ApartmentAndFacility apartmentAndFacility)
    {
        return apartmentAndFacilityMapper.insertApartmentAndFacility(apartmentAndFacility);
    }

    /**
     * 修改公寓设置中间表
     *
     * @param apartmentAndFacility 公寓设置中间表
     * @return 结果
     */
    @Override
    public int updateApartmentAndFacility(ApartmentAndFacility apartmentAndFacility)
    {
        return apartmentAndFacilityMapper.updateApartmentAndFacility(apartmentAndFacility);
    }

    /**
     * 批量删除公寓设置中间表
     *
     * @param ids 需要删除的公寓设置中间表主键
     * @return 结果
     */
    @Override
    public int deleteApartmentAndFacilityByIds(Long[] ids)
    {
        return apartmentAndFacilityMapper.deleteApartmentAndFacilityByIds(ids);
    }

    /**
     * 删除公寓设置中间表信息
     *
     * @param id 公寓设置中间表主键
     * @return 结果
     */
    @Override
    public int deleteApartmentAndFacilityById(Long id)
    {
        return apartmentAndFacilityMapper.deleteApartmentAndFacilityById(id);
    }
}
